Basic Workflow

STEMCOR is aimed for correction of various image distortions that are accumuilated during STEM scanning.

The algorithms behind correction are described in arxiv 2605.11018

Consider, for instance, two STEM images taken with mutual perpendicular fast scanning directions are compared.

The basic workflow proceeds by pressing the buttons in the lower panel of the tool. The user simply clicks the processing buttons from left to right and visually checks the results. You can always return to previous processing steps to inspect the correction state. Finally, the project and intermediate images can be stored.

Processing Flow

Load Data

Two essentially identical images acquired in the original orientation and in the 90° clockwise-rotated orientation are required. The former should be placed in the left window and the latter in the right window of the tool. The easiest way is to click the open O or open R buttons and choose the corresponding files, for example in Gatan dm3/dm4 format.

Loading Data
  • Supported formats
  • You can also load two files at once by clicking the OPEN button in the project field and selecting both files while holding the CTRL key.

    STEMCorrector can handle only one dataset at a time. If you wish to work with several datasets in parallel, start another instance of SpectrumImager.

    The image in the original orientation must be on the left and the rotated one on the right. You can verify this by reading the captions in the upper bar of the tool. If the images are swapped, exchange them using the icon between the windows

    You might wonder why the right image has a red border. This simply reminds you that it is rotated relative to the left one. It is recommended to click the Exchanging Images icon for better comparison (the red border disappears).

    Loading Data

    Even after rotating the right image clockwise, the images still appear sheared relative to each other. This is due to linear drift during acquisition, which distorts the lattice. You can visualize this clearly by clicking the small icon under the left image — this briefly switches between the two images.

    Linear Correctiong

    Loading a series of images at once is also possible.

  • Treating series of images
  • Linear Correction

    It is now time to apply linear correction. The program determines the shift between the two images and calculates the continuous drift, provided that the pause between the two acquisitions was minimal.

    Before starting, determine whether your images are atomically resolved. This is very important, as the shift is evaluated differently for different resolutions. FFT analysis is used for atomic-resolution images, while cross-correlation is used for lower-resolution images. The FFT method does not work for low-resolution images, while cross-correlation for high-resolution images is reasonable only if a clearly recognizable pattern exists on top of the atomic lattice.

    After choosing the appropriate method, press LINEAR.

    The affine transformation changes the image size. Between the left and right windows, there is a "frames" icon that allows you to view the results in different frames.

    View different frames

    Initially, the display retains the original image size, cutting off some edges. The first click shows the complete (largest) view of both images. The second click shows the minimal area, i.e. a rectangle with no out-of-image pixels. Further clicks cycle through these views.

    The current image width and height (in pixels) are displayed in the bar between the windows.

  • Linear correction in details
  • Non-Linear Correction

    Although linear correction significantly improves the agreement between the left and right images (check with the click), it may still be insufficient. You may observe local jumps and shears, as well as a general misalignment.

    Non-Linear Correction

    Press the NON LINEAR button and, hopefully, achieve a better match between the two images.

    Note that no explicit reference is used for this correction. The method relies solely on the different distortion orientations in the two images, so the result should approach the ground truth.

  • Non-linear correction in details
  • Merging two corrected images

    You may want to sum both images to improve statistics or smooth small imperfections not fully corrected. Simply press the last processing button — MERGE.

    Non-Linear Correction

    At this step, the frame size cannot be changed; only the minimal common area (with no out-of-image pixels) is used.

    Merged Image
  • Merging in details
  • Inspecting and Storing Results

    The square numbered icons at the bottom bar represent the correction steps. By clicking them, you can view previous states. At each step, you can export the left or right image ( EXPORT ) to Gatan or other formats, or store a snapshot display as jpeg ( SNAP ).

    Storing and Exporting
  • Export images in details
  • It is also recommended to save the entire project in the native TEMDM format. Press SAVE in the project field. You can later reopen the all images without reprocessing through every step.

    Except of images, a number of other information sets are created during processing. You can look at it via Menu Show

  • Inspecting and storing correction resuts in details
  • Also, you may notice that the correction example above contains one inaccuracy — the left and right images are shifted relative to each other by half a lattice period. As a result, the superstructure is washed out in the merged image. Such a shift can occur because the algorithm struggles to distinguish two sublattices, especially if the difference in atoms intensity is not large.

    You can fix that by setting sticking points

  • Guiding correction with sticking points
  • .

    Types of Images

    The default input for STEMCorrector is a pair of STEM images in the original and 90° rotated scan orientations. However, STEM images are often collected in big series. Then, loading indivudual images into STEMCorrector and filtering them onto the original and rotated orientations is too boring. You can however assign them the standard names and then load and treat all images as one package.

    Types of images

    In 'project', just change the type to 'series' and then load and treat a number of STEM pairs in one flow.

    STEMCorrector Help – Index

    Topics Index

    Select a topic below: